<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>

// 构造函数
function Person(name){
    this.name = name;
}
// 将方法 （行为）添加到 构造函数的原型对象上
Person.prototype.sayHi = function(){
    console.log('这是原型对象上的说话方法');
}



</script>
</html>